import {EventKey} from "../common_for_guosheng/Key";


// import { EventKey } from "../common/Key";

import { GameGSData } from "../game_for_guosheng/GameGSData";

cc.Class({
    extends: cc.Component,

    properties: {
        labDiamond: cc.Label,
    },

    onLoad() {
        F.OnEvent.on(EventKey.EVENT_DIAMOND_CHANGE, this._onFuckFire, this);
        this.node.on('click', () => {
            F.GSPartner.sendEvent('打开弹窗', { '类型': '获取钻石' });
            F.Ui.openUI('PanelAddDiamond')
        }, this)
    },
    onDestroy() {
        F.OnEvent.off(EventKey.EVENT_DIAMOND_CHANGE, this._onFuckFire, this);
    },
    _onFuckFire() {
        this._updataFuckDiamond();
    },
    onEnable() {
        this._updataFuckDiamond();
    },
    _updataFuckDiamond() {
        this.labDiamond.string = GameGSData.getDiamond();
    },
    // update (dt) {},
});
